package com.breaktian.assemble.utils;

import android.os.SystemClock;

/**
 * Created by keke.tian on 2017/9/5.
 */

public class ClickUtil {

    private static long lastClickTime = 0;


    /**
     * Check if user click "Button" fast.
     * @return true,fast click;otherwise false.
     */
    public static boolean isFastClick() {
        long currentTime = SystemClock.uptimeMillis();
        long timeDelta = currentTime - lastClickTime;
        if (timeDelta < 500) {
            return true;
        }

        lastClickTime = currentTime;
        return false;
    }
}
